<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加学生</title>
    <link rel="stylesheet" href="/styles/student.css">
</head>
<body>
    <header>
        <div>
            <div>
                <i>🎓</i>
                <h1>教育查询系统</h1>
            </div>
        </div>
    </header>
    
    <div class="form-container">
        <h2>添加新学生</h2>
        
        {{if .Error}}
        <div class="error-message">{{.Error}}</div>
        {{end}}
        
        <form action="/addstudent" method="POST">
            <div class="form-group">
                <label for="student_id">学生ID:</label>
                <input type="text" id="student_id" name="student_id" required>
            </div>
            
            <div class="form-group">
                <label for="name">姓名:</label>
                <input type="text" id="name" name="name" required>
            </div>
            
            <div class="form-group">
                <label for="gender">性别:</label>
                <input type="text" id="gender" name="gender" required>
            </div>
            
            <div class="form-group">
                <label for="enrollment_year">入学年份:</label>
                <input type="text" id="enrollment_year" name="enrollment_year" required>
            </div>
            
              <div class="form-group">
                <label for="major_id">专业ID:</label>
                <input type="text" id="major_id" name="major_id" required>
                <p class="help-text">请输入有效的专业ID</p>
                <a href="/major">查看已有专业</a>
            </div>
            
            <div class="form-group">
                <label for="class_id">班级ID:</label>
                <input type="text" id="class_id" name="class_id" required>
                <p class="help-text">请输入有效的班级ID</p>
                <a href="/class">查看已有班级</a>
            </div>
            
            <div class="form-group">
                <label for="parent_phone">家长电话:</label>
                <input type="text" id="parent_phone" name="parent_phone" required>
            </div>
            
            <div class="form-group">
                <label for="final_avg_score">期末平均分:</label>
                <input type="number" step="0.01" id="final_avg_score" name="final_avg_score" required>
            </div>
            
            <div class="form-group">
                <label for="status">状态:</label>
                <input type="text" id="status" name="status" required>
            </div>
            
            <button type="submit">添加学生</button>
        </form>
    </div>
    <form action="/student" method="GET">
        <button type="submit" class="add-button">返回学生列表</button>
    </form>
</body>
</html>